import request from '../utils/request';
import { API_PATHS } from '../constants/api';

// 连接器列表查询参数
export interface ConnectorListParams {
  current?: number;
  size?: number;
  connectorName?: string;
  status?: string;
  [key: string]: any;
}

// 连接器信息接口
export interface ConnectorInfo {
  id: string;
  connectorName: string;
  connectorType: string;
  status: string;
  provider: string;
  description: string;
  accessKey: string;
  secretKey: string;
  createdAt: string;
  updatedAt: string;
  lastAccessTime: string;
  permissions: string[];
}

// 分页响应接口
export interface PaginationResponse<T> {
  records: T[];
  total: number;
  size: number;
  current: number;
}

// 获取连接器列表
export async function getConnectorList(params: ConnectorListParams): Promise<PaginationResponse<ConnectorInfo>> {
  const response = await request.post(API_PATHS.CONNECTOR.LIST, params);
  return response.data;
} 